#include "pch.h"
#include "DisplayConfigurationMonitor.h"


bool DisplayConfigurationMonitor::IsChanged() {
	DesktopRect rect = DesktopRect::MakeXYWH(GetSystemMetrics(SM_XVIRTUALSCREEN),
		GetSystemMetrics(SM_YVIRTUALSCREEN),
		GetSystemMetrics(SM_CXVIRTUALSCREEN),
		GetSystemMetrics(SM_CYVIRTUALSCREEN));

	if (!initialized_) {
		initialized_ = true;
		rect_ = rect;
		return false;
	}

	if (rect.equals(rect_)) {
		return false;
	}

	rect_ = rect;
	return true;
}

void DisplayConfigurationMonitor::Reset() {
	initialized_ = false;
}
